Add InvoiceReceipt template and update rendering modes to replace the hardcoded mode:email#45
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #45 +/- ##
=======================================
Coverage 95.50% 95.50%
=======================================
Files 31 31
Lines 1937 1937
Branches 382 382
=======================================
Hits 1850 1850
Misses 86 86
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Thanks for the PR! Overall, the implementation looks good. The project builds successfully, all tests pass, and the invoice renders correctly in the demo using Document mode. I tested the PDF generation workflow shown in the example. When exported as A4, the pagination isn’t clean: the main invoice appears on page 1, the footer moves to a mostly empty page 2, and page 3 is blank. Since the template is described as print-ready, this pagination issue is worth taking a look at. Otherwise, the invoice component and rendering-mode changes look good. |
|
@ivoIturrieta Fixed. Please check :) |
|
@yeabwang Thanks for the update! I traced the trailing page break and it comes from the document body renderer in For PDF generation in the meantime, consumers can use renderToJson() to create Unlayer-compatible design JSON and send it to the Cloud API’s PDF export endpoint from their backend. The API key must remain server-side. Examples:
|
b689c8e to
cf663e1
Compare
|
@ivoIturrieta Okay I've updated as requested including removal of the previous Puppeteer based one. One thing to bring to your attention the Cloud API PDF export API display mode doesn't have document and it only supports "email" "web" "popup" so defaulted to web. I've checked the web and pdf version of the invoice, the web one render as expected, but the pdf one has the trailing page issue but since you said it will be fixed upstream I left it as it is. If there are any issues happy to address them :) |
ivoIturrieta
left a comment
There was a problem hiding this comment.
Looks good! thanks for the contribution
Summary
Adds a print-ready invoice/receipt template and renders each demo template using its configured mode. Addressing #20
Changes
Test Plan
pnpm buildpassespnpm testpassesNotes
Any additional context for reviewers.